home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / NW41BAS.ZIP / WINSLIST.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-30  |  6.5 KB  |  212 lines

  1. VERSION 2.00
  2. Begin Form WINSLIST 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "WinSlist 2.0"
  6.    ClientHeight    =   3576
  7.    ClientLeft      =   2016
  8.    ClientTop       =   2892
  9.    ClientWidth     =   6036
  10.    ControlBox      =   0   'False
  11.    Height          =   4128
  12.    Left            =   1968
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3576
  17.    ScaleWidth      =   6036
  18.    Top             =   2388
  19.    Width           =   6132
  20.    Begin CommandButton Command5 
  21.       Caption         =   "&Bindery Info"
  22.       Height          =   435
  23.       Left            =   4320
  24.       TabIndex        =   9
  25.       Top             =   2784
  26.       Width           =   1575
  27.    End
  28.    Begin CommandButton Command4 
  29.       Caption         =   "&Volume Info"
  30.       Height          =   435
  31.       Left            =   2208
  32.       TabIndex        =   8
  33.       Top             =   2784
  34.       Width           =   1575
  35.    End
  36.    Begin CommandButton Command3 
  37.       Caption         =   "&Server Info"
  38.       Height          =   435
  39.       Left            =   144
  40.       TabIndex        =   7
  41.       Top             =   2784
  42.       Width           =   1575
  43.    End
  44.    Begin CommandButton Command2 
  45.       Caption         =   "&Exit"
  46.       Height          =   495
  47.       Left            =   4620
  48.       TabIndex        =   2
  49.       Top             =   2112
  50.       Width           =   1275
  51.    End
  52.    Begin CommandButton Command1 
  53.       Caption         =   "&ReScan"
  54.       Height          =   495
  55.       Left            =   120
  56.       TabIndex        =   1
  57.       Top             =   2112
  58.       Width           =   1095
  59.    End
  60.    Begin ListBox ServerList 
  61.       Height          =   1368
  62.       Left            =   120
  63.       Sorted          =   -1  'True
  64.       TabIndex        =   0
  65.       Top             =   660
  66.       Width           =   5772
  67.    End
  68.    Begin Line Line2 
  69.       BorderColor     =   &H000000FF&
  70.       X1              =   144
  71.       X2              =   5904
  72.       Y1              =   2688
  73.       Y2              =   2688
  74.    End
  75.    Begin Line Line1 
  76.       X1              =   120
  77.       X2              =   5880
  78.       Y1              =   300
  79.       Y2              =   300
  80.    End
  81.    Begin Label Label6 
  82.       BackStyle       =   0  'Transparent
  83.       Caption         =   "Label6"
  84.       ForeColor       =   &H00FF0000&
  85.       Height          =   255
  86.       Left            =   3060
  87.       TabIndex        =   11
  88.       Top             =   360
  89.       Width           =   2835
  90.    End
  91.    Begin Label Label5 
  92.       Alignment       =   1  'Right Justify
  93.       BackStyle       =   0  'Transparent
  94.       Caption         =   "Currently Selected Server:"
  95.       Height          =   255
  96.       Left            =   180
  97.       TabIndex        =   10
  98.       Top             =   360
  99.       Width           =   2715
  100.    End
  101.    Begin Label Label4 
  102.       Alignment       =   2  'Center
  103.       BackStyle       =   0  'Transparent
  104.       Caption         =   "Select a Server then click an Action Button."
  105.       Height          =   252
  106.       Left            =   144
  107.       TabIndex        =   6
  108.       Top             =   3264
  109.       Width           =   5772
  110.    End
  111.    Begin Label Label3 
  112.       BackStyle       =   0  'Transparent
  113.       Caption         =   "Label 3"
  114.       FontBold        =   -1  'True
  115.       FontItalic      =   0   'False
  116.       FontName        =   "MS Sans Serif"
  117.       FontSize        =   12
  118.       FontStrikethru  =   0   'False
  119.       FontUnderline   =   0   'False
  120.       ForeColor       =   &H00000000&
  121.       Height          =   375
  122.       Left            =   3660
  123.       TabIndex        =   5
  124.       Top             =   2220
  125.       Width           =   855
  126.    End
  127.    Begin Label Label2 
  128.       Alignment       =   1  'Right Justify
  129.       BackStyle       =   0  'Transparent
  130.       Caption         =   "Total Servers:"
  131.       FontBold        =   -1  'True
  132.       FontItalic      =   0   'False
  133.       FontName        =   "MS Sans Serif"
  134.       FontSize        =   12
  135.       FontStrikethru  =   0   'False
  136.       FontUnderline   =   0   'False
  137.       ForeColor       =   &H000000FF&
  138.       Height          =   375
  139.       Left            =   1440
  140.       TabIndex        =   4
  141.       Top             =   2220
  142.       Width           =   2115
  143.    End
  144.    Begin Label Label1 
  145.       Alignment       =   2  'Center
  146.       BackStyle       =   0  'Transparent
  147.       Caption         =   "List of all Visible Netware Servers"
  148.       Height          =   315
  149.       Left            =   180
  150.       TabIndex        =   3
  151.       Top             =   60
  152.       Width           =   5655
  153.    End
  154.    Begin Menu about 
  155.       Caption         =   "&About"
  156.    End
  157. Sub about_Click ()
  158.     WinSlist.Hide
  159.     aboutform.Show
  160. End Sub
  161. Sub Command1_Click ()
  162.     ServerList.Clear
  163.     Label3.Caption = "???"
  164.     ScanForServers
  165.     Label3.Caption = ServerList.ListCount
  166.     ServerList.ListIndex = 0
  167.     Label6.Caption = RTrim$(ServerList.List(ServerList.ListIndex))
  168. End Sub
  169. Sub Command2_Click ()
  170.     End
  171. End Sub
  172. Sub Command3_Click ()
  173.     ServerInfo.Show 1
  174. End Sub
  175. Sub Command4_Click ()
  176.     VolInfo.Show 1
  177. '    MsgBox "Not yet written - Sorry", 0, "Look for it Later!!"
  178. End Sub
  179. Sub Command5_Click ()
  180.     BindInfo.Show 1
  181.     'MsgBox "Not yet written - Sorry", 0, "Look for it Later!!"
  182. End Sub
  183. Sub Form_Load ()
  184.     'Center the Form
  185.     Left = (Screen.Width - Width) / 2
  186.     Top = (Screen.Height - Height) / 2
  187.     'Initialize some variables
  188.     'Used in MSGBox's and the about Box
  189.     A_TAB = Chr$(9)
  190.     CRLF = Chr$(13) + Chr$(10)
  191.     ScanForServers
  192.     Label3.Caption = ServerList.ListCount
  193.     ServerList.ListIndex = 0
  194.     Label6.Caption = RTrim$(ServerList.List(ServerList.ListIndex))
  195. End Sub
  196. Sub ScanForServers ()
  197.     oID& = -1   'initialize object ID to -1 for first call to ScanBinderyObject
  198.     Ret% = NWGetPrimaryConnectionID(ConnID%)
  199.     Do
  200.         serverName$ = String$(48, 0)
  201.         cCode% = NWScanObject(ConnID%, "*", OT_FILE_SERVER, oID&, serverName$, oType%, oHasProps%, oFlag%, oSecurity%)
  202.         If (cCode% = SUCCESSFUL) Then
  203.             'take all characters of object name up to terminating null
  204.             serverName$ = Left$(serverName$, InStr(serverName$, Chr$(0)) - 1)
  205.             ServerList.AddItem serverName$
  206.         End If
  207.     Loop Until cCode%
  208. End Sub
  209. Sub ServerList_Click ()
  210.     Label6.Caption = RTrim$(ServerList.List(ServerList.ListIndex))
  211. End Sub
  212.